//
//  Unit.h
//  FMDB-demo
//
//  Created by apple on 14-11-12.
//  Copyright (c) 2014年 LXH. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface Unit : NSObject


/**
 *
 *  提示一个警告，填写警告的字符
 *
 *  @param message
 */
+ (void)showAlert:(NSString *)message;

/**
 *  提示一个警告，参数timer为NSTimer
 *
 *  @param timer
 */
+ (void)removeAlert:(NSTimer *)timer;


/**
 *  提示网络错误
 */
+ (void)showNetFail;

//创建UILabel

/**
 *  工厂方法，创建一个Label
 *
 */
+ (UILabel*)createLable:(CGRect)frame withName:(NSString *)name withFont:(CGFloat)font;
//创建UIButton
+(UIButton*)creatButton:(CGRect)frame withName:(NSString*)name normalImg:(UIImage*)normalImg highlightImg:(UIImage*)highlightImg selectImg:(UIImage*)selectImg;
//创建UITextField
+ (UITextField *)createTextField:(CGRect)frame withPlaceholder:(NSString *)placeholder;
//创建UITableView
+ (UITableView *)createTableView:(CGRect)frame withDelegate:(id)delegate;
//创建UIImageView
+ (UIImageView *)createImageView:(CGRect)frame isRound:(BOOL)isRound;
//创建UIScrollView

/**
 *  创建ScrollView
 *
 *  @param frame
 *  @param delegate
 *  @param contentSize
 *
 */
+ (UIScrollView *)createScrollView:(CGRect)frame withDelegate:(id)delegate withContentSize:(CGSize)contentSize;

/**
 *  根据指定Label的宽度以及字符串长度，返回适应的Label的高度
 *
 *  @param string
 *  @param font
 *  @param width
 *
 *  @return
 */
+ (CGFloat)heightWithString:(NSString *)string font:(UIFont *)font constrainedToWidth:(CGFloat)width;
+ (CGFloat)widthWithString:(NSString *)string font:(UIFont *)font;
#pragma mark -- image的翻转
+ (UIImage *)rotateImage:(UIImage *)aImage;
//判断手机号码


/**
 *  判断字符串是否未手机号码，返回YES是手机号码
 *
 *  @param mobileNum
 *
 *  @return YES 是手机号码
 */
+ (BOOL)isMobileNumber:(NSString *)mobileNum;



/**
 *  检查ios审核屏蔽开启
 */
+ (BOOL)checkIOSSettingReview;


@end
